﻿@using Seal.Model
@using Seal.Helpers
@{
    Report report = Model;
    ReportView view = report.CurrentView;
    Repository repository = report.Repository;
}

@if (!report.OnlyBody)
{
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link id='favicon' rel='shortcut icon' href='@report.AttachImageFile("favicon.ico")' type='image/x-icon' />
        <title>
            @report.ExecutionName
        </title>

        <!--CSS-->
    @Raw(report.AttachCSSFile("datatables.min.css", report.GenerateHTMLDisplay && report.ExecutionContext == ReportExecutionContext.DesignerReport ? "" : "https://cdn.datatables.net/v/bs-3.3.7/jq-3.6.0/dt-1.13.4/b-2.3.6/date-1.4.1/fc-4.2.2/fh-3.3.2/r-2.4.1/sc-2.1.1/sl-1.6.2/datatables.min.css"))
        @Raw(report.AttachCSSFile("bootstrap-select.min.css", "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css"))
        @Raw(report.AttachCSSFile("bootstrap-datetimepicker.min.css"))

        @Raw(report.AttachCSSFiles(repository.Configuration.CssFiles))
        @Raw(report.AttachCSSFile("seal.css"))

        <!--Scripts-->
    @Raw(report.AttachScriptFile("datatables.min.js", "https://cdn.datatables.net/v/bs-3.3.7/jq-3.6.0/dt-1.13.4/b-2.3.6/date-1.4.1/fc-4.2.2/fh-3.3.2/r-2.4.1/sc-2.1.1/sl-1.6.2/datatables.min.js"))
        @Raw(report.AttachScriptFile("bootstrap-select.min.js", "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"))
        @Raw(report.AttachScriptFile("moment.min.js"))
        @if (view.CultureInfo.TwoLetterISOLanguageName != "en")
        {
            @Raw(report.AttachScriptFile("i18n\\moment." + view.CultureInfo.TwoLetterISOLanguageName + ".js"))
            @Raw(report.AttachScriptFile("i18n\\selectpicker." + view.CultureInfo.TwoLetterISOLanguageName + ".min.js"))
        }
        @Raw(report.AttachScriptFile("bootstrap-datetimepicker.min.js"))

        @Raw(report.AttachScriptFile("datetime-moment.js"))
        @if (report.HasChart)
        {
            @Raw(report.AttachScriptFile("d3.min.js"))
            @Raw(report.AttachScriptFile("d3-time.v1.min.js", "https://d3js.org/d3-time.v1.min.js"))
            @Raw(report.AttachScriptFile("d3-time-format.v2.min.js", "https://d3js.org/d3-time-format.v2.min.js"))
            @Raw(report.AttachScriptFile("d3\\" + view.CultureInfo.TwoLetterISOLanguageName + ".js"))
        }
        @Raw(report.AttachScriptFile("gauge.min.js"))

        @Raw(report.AttachScriptFiles(repository.Configuration.ScriptFiles))

        @Raw(report.AttachScriptFile("helpers.js"))
        @Raw(report.AttachScriptFile("common.js"))
        @Raw(report.AttachScriptFile("custom.js"))
    </head>
    <body>
        @Include(view.GetPartialTemplateKey("Report.iHeader", view), view)
        @Include(view.GetPartialTemplateKey("Report.iBody", view), view)
    </body>
    </html>
}
else
{
    //Just body from the Web Menu
    @Include(view.GetPartialTemplateKey("Report.iBody", view), view)
}